Method and device for electrostatic desalter optimization for enhanced metal and amine removal from crude oil

ABSTRACT

A method for removing calcium, iron, other metals, and amines from crude oil in a refinery desalting process includes the steps of: running a plurality of tests to determine at least one statistically significant processing characteristic of the refinery desalting process; adding a wash water to the crude oil; adding the wash water to the crude oil to create an emulsion; adding to the wash water, the crude oil or the emulsion an acid additive consisting of at least one of the following: oxalic acid, citric acid, water-soluble hydroxyacid selected from the group consisting of glycolic acid, gluconic acid, C.sub.2-C.sub.4 alpha-hydroxy acids, malic acid, lactic acid, poly-hydroxy carboxylic acids, thioglycolic acid, chloroacetic acid, polymeric forms of the above hydroxyacids, poly-glycolic esters, glycolate ethers, and ammonium salt and alkali metal salts of these hydroxyacids, and mixtures thereof; resolving the emulsion containing the acid additive into a hydrocarbon phase and an aqueous phase; and adjusting a control setting of the processing characteristic as a function of the tests.

FIELD OF THE INVENTION

The present invention relates to a method and device for determining thestatistically optimal desalter parameter settings for removing metals,amines and other contaminants from crude oil at minimum cost viaelectrostatic coalescence.

BACKGROUND INFORMATION

U.S. Pat. No. 4,853,109 discloses a method for removing metalcontaminants, particularly iron and non-porphyrin, organically-boundiron components from crude petroleum. This process comprises mixingcrude oil with an aqueous solution of hydroxo-carboxylic acids or saltsthereof, preferably citric acid, and separating the aqueous solution andmetals from the crude.

U.S. Pat. No. 5,078,858 discloses a method for extracting iron speciesfrom crude oil by directly adding oxalic or citric acid to the crude oilfeedstock, mixing the acid and oil, then adding wash water to form awater in oil emulsion. The emulsion is resolved separating the aqueoussolution and metals from the crude.

U.S. Pat. No. 7,497,943 discloses a method for transferring metalsand/or amines from a hydrocarbon phase to a water phase in an oilrefinery desalting process. The method consists of adding to a washwater an effective amount of a composition comprising certainwater-soluble hydroxyacids to transfer metals and/or amines from ahydrocarbon phase to a water phase. The water-soluble hydroxyacid isselected from the group consisting of glycolic acid, gluconic acid,C.sub.2-C.sub.4 alpha-hydroxyacids, malic acid, lactic acid,poly-hydroxy carboxylic acids, thioglycolic acid, chloroacetic acid,polymeric forms of the above hydroxyacids, poly-glycolic esters,glycolate ethers, ammonium salt and alkali metal salts of thesehydroxyacids, and mixtures thereof. The pH of the wash water is loweredto 6 or below, before, during and/or after adding the composition andthe wash water is added to crude oil to create an emulsion. Finally, theemulsion is resolved into the hydrocarbon phase and an aqueous phaseusing electrostatic coalescence, where at least a portion of the metalsand/or amines are transferred to the aqueous phase.

Optimum Temperature in the Electrostatic Desalting of Maya Crude Oil byPruneda et al published in the 2005 Journal of the Mexican ChemicalSociety discloses a simulation model which suggests that there is anoptimum temperature to maximize economic benefit when desalting heavycrude oil. As indicated in the art, an increase in process temperaturehas two effects to be considered. First, as temperature is increased,there is a corresponding decrease in oil density and viscosity whichimplies a significant increase in the settling rate of water dropletswithin the oil phase thus allowing a greater amount of oil to beprocessed resulting in an increase in profit from performing oildesalting. However, crude oil conductivity increases exponentially withtemperature which implies a higher rate of electrical power consumptionduring electrostatic coalescence which increases processing expense.

Basic Statistics by Kiemele et al published in 1991 discloses basicstatistical hypothesis testing techniques and statistical designtechniques. In the techniques outlined by Kiemele et al, alldecision-making operations are made by a human operator.

U.S. Pat. No. 4,853,109, U.S. Pat. No. 5,078,858, U.S. Pat. No.7,497,943, Optimum Temperature in the Electrostatic Desalting of MayaCrude Oil by Pruneda et al, and Basic Statistics by Kiemele et al arehereby incorporated by reference herein.

SUMMARY OF THE INVENTION

The present invention provides a method for removing calcium, iron,other metals, and amines from crude oil in a refinery desalting processincludes the steps of: running a plurality of tests to determine atleast one statistically significant processing characteristic of therefinery desalting process; adding a wash water to the crude oil; addingthe wash water to the crude oil to create an emulsion; adding to thewash water, the crude oil or the emulsion an acid additive consisting ofat least one of the following: oxalic acid, citric acid, water-solublehydroxyacid selected from the group consisting of glycolic acid,gluconic acid, C.sub.2-C.sub.4 alpha-hydroxy acids, malic acid, lacticacid, poly-hydroxy carboxylic acids, thioglycolic acid, chloroaceticacid, polymeric forms of the above hydroxyacids, poly-glycolic esters,glycolate ethers, and ammonium salt and alkali metal salts of thesehydroxyacids, and mixtures thereof; resolving the emulsion containingthe acid additive into a hydrocarbon phase and an aqueous phase; andadjusting a control setting of the processing characteristic as afunction of the tests.

The present invention also provides a method for improving a refinerydesalting process comprising the steps of: providing a range of valuesfor at least one candidate variable representing a desalting processcharacteristic; performing a statistical calculation to determine atleast one statistically significant candidate variable of the at leastone candidate variable which is statistically significant for improvingthe refinery desalting process; and adjusting a control setting of thedesalting process as a function of the statistical calculation.

An oil refinery, desalter and laboratory equipment are also provided.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 shows a block diagram of a typical single stage crude oilelectrostatic desalting mechanism according to one embodiment of thepresent invention;

FIG. 2 shows a block diagram of a typical first stage dehydrationfollowed by a second stage electrostatic desalting mechanism accordingto one embodiment of the present invention;

FIG. 3 shows a block diagram of a typical two stage electrostaticdesalting mechanism according to one embodiment of the presentinvention;

FIG. 4 shows an algorithm diagram for a multiple variable, two-levelstatistical quantification and estimation of performance for a givencrude oil desalter according to one embodiment of the present invention;

FIG. 5 shows a diagram of one embodiment of the method of the presentinvention for a typical crude oil desalting operation.

DETAILED DESCRIPTION

FIG. 1 shows a diagram of a single stage crude oil electrostaticdesalting mechanism 1000 of the present invention.

The desalting mechanism 1000 of the present invention includes a crudeoil supply 10 for storing crude oil. The crude oil supply 10 isconnected to a controllable pump 70 which is connected to an optionalcontrollable fluid mixer 80. The optional controllable fluid mixer 80allows an emulsion of crude oil 10, wash water 20, and acid additive 30to be created prior to heating based upon the specific characteristicsof the crude oil supply 10 to be desalted. The optional controllablefluid mixer 80, if necessary to process the crude oil supply 10, iscontrolled by the controller 110 to create and maintain the properemulsion mix of crude oil 10, wash water 20, and acid additive 30.

Following either the controllable pump 70 or the optional controllablefluid mixer 80 is a controllable flow control valve (FCV) 120. Thecontrollable flow control valve 120 and the controllable pump 70 work inconjunction under command of the controller 110 to control and maintainthe crude oil feed rate and pressure. The crude oil 10 or crude oilemulsion created via optional controllable fluid mixer 80 is then heatedto a desired processing temperature by the heater 130 which iscontrolled by controller 110.

The desalting mechanism 1000 of the present invention also includes awash water supply 20 and an acid additive supply 30. In the embodimentof FIG. 1, as is preferred, the acid additive 30 is mixed with the washwater 20 by the controllable fluid mixer 40 before the crude oil/washwater emulsion is formed. Alternatively, the acid additive 30 could bemixed with the wash water 20 and crude oil 10 during the emulsioncreation or after water-oil emulsion creation or with the crude oil 10.The fluid mixer 40 is controlled by the controller 110 to create andmaintain the proper solution mixture of acid additive 30 and wash water20. The acid additive 30 can be selected from the group consisting ofoxalic acid, citric acid, glycolic acid, gluconic acid, C.sub.2-C.sub.4alpha-hydroxy acids, malic acid, lactic acid, poly-hydroxy carboxylicacids, thioglycolic acid, chloroacetic acid, polymeric forms of theabove hydroxyacids, poly-glycolic esters, glycolate ethers, and ammoniumsalt and alkali metal salts of these hydroxyacids, and mixtures thereof.

After mixing the solution of acid additive 30 and wash water 20 with thecontrollable fluid mixer 40, the resulting solution is input to acontrollable flow control valve 90 which is used to allow samples of themixed acid additive 30 and wash water 20 solution to be measured at ameasurement station 200. Measurements made on the solution samples wouldinclude but not be limited to solution pH, solution impurity levels, andpercentage of acid additive 30 to wash water 20. This information issent to the controller 110.

After mixing the solution of acid additive 30 and wash water 20 with thecontrollable fluid mixer 40, the resulting solution is also input to acontrollable pump 50 whose output is connected to a controllable flowcontrol valve 60. The controllable pump 50 and the flow control valve 60work in conjunction under the command of the controller 110 to controland maintain the wash water/acid solution feed rate and pressure. In theembodiment of FIG. 1, the controllable flow control valve 60 is shown tobe a three-way valve to allow for emulsion creation with the crude oilsupply 10 via the optional controllable fluid mixer 80, the optionalcontrollable fluid mixer 140, or both. Like the optional controllablefluid mixer 80, the optional controllable fluid mixer 140, if necessaryto process the crude oil supply 10, is controlled by the controller 110to create and maintain the proper emulsion mix of crude oil 10, washwater 20, and acid additive 30. The controllable flow control valve 60also allows for the acid additive 30 and wash water 20 solution to bepresented to the optional controllable fluid mixer 80 and optionalcontrollable fluid mixer 140 at the same or different flow rates whenboth mixer devices are used in the desalting process.

Following the optional controllable fluid mixer 140, the emulsion passesthrough a pressure control valve 160 before entering the electrostaticdesalter 170. The electrostatic desalter 170 includes a liquid levelsensor (LS) 210 used to measure the aqueous level in the electrostaticdesalter 170. In the embodiment of FIG. 1, the measurement output of theliquid level sensor 210 is routed to the controller 110. The controller110 uses the liquid level measurement data to control the controllableflow control valve 220 to drain the effluent from the electrostaticdesalter 170 and control the aqueous layer and emulsion layer within theelectrostatic desalter 170. Alternatively, the liquid level sensor 210output may be directly connected to a level control valve instead of thecontrollable flow control valve 220 to drain the effluent. Thecontrollable flow control valve 220 is also configured to allow samplesof the effluent solution to be measured at a measurement station 200.Measurements made on the solution samples would include but not belimited to solution pH, solution impurity levels, temperature, andamount of residual oil present in the effluent. This information is sentto the controller 110.

The electrical power supply 150 provides the voltage necessary to createthe electric field necessary for electrostatic coalescence in theelectrostatic desalter 170. The controller 110 controls the electricalpower supply 150 output. The electrical power supply 150 output may bestatic (i.e. constant voltage with a current limit) or, preferably, ableto change key parameters to enhance the desalting operation. Theelectrical power supply 150 under the control of the controller 110would preferably be able to alter its' output to include but not belimited to changes in the voltage level applied to the electrostaticdesalter 170, the voltage waveform applied to the electrostatic desalter170, current limits (if any) on the electrical power supply 150, or anycombination thereof.

The desalted crude output of the electrostatic desalter 170 passesthrough a pressure control valve 180 and a controllable flow controlvalve 190. The controllable flow control valve 190 has two outputs todirect the desalted crude oil. Under control of the controller 110, thecontrollable flow control valve 190 controls and maintains the flow rateof desalted crude oil to the remaining refinery operations.Additionally, under control of the controller 110, the controllable flowcontrol valve 190 can also direct samples of the desalted crude to themeasurement station 200. Measurements made on the solution samples wouldinclude but not be limited to impurity levels, temperature, residualacid additive 30 and wash water 20 solution, etc. This information issent to the controller 110.

The controller 110 can adjust various parameters of the desaltingoperation including but not limited to the following:

The crude oil supply 10 feed rate through the controllable pump 70 andcontrollable flow control valve 120

The temperature of the crude oil supply 10 or, optionally, the emulsioncreated by mixing the crude oil supply 10 with a solution comprising theacid additive 30 and/or wash water 20 through the controllable heater130.

The solution mixture of acid additive 30 and wash water 20 through thecontrollable fluid mixer 40.

The flow rate of the solution mixture of acid additive 30 and wash water20 through the controllable pump 50 and controllable flow control valve60.

The emulsion formation through optional controllable fluid mixer 80and/or optional controllable fluid mixer 140.

The electrostatic desalter 170 electric field through the controllableelectrical power supply 150.

Control of the electrostatic desalter water level and emulsion layersthrough the liquid level sensor 210, the controllable flow control valve220, and the controllable flow control valve 190.

As different tests are conducted with the desalting mechanism 1000, theparameters are adjusted per the test matrix and the selected productmeasurements are made after desalting the crude oil supply 10. Thememory/data storage 100 function of the desalting mechanism 1000 allowsthe controller to access and update, if required, the control settingsrequired to conduct the test matrix tests and store the measured data.

FIG. 2 shows a diagram of a typical first stage dehydration followed bya second stage electrostatic desalting mechanism 2000 of the presentinvention.

The desalting mechanism 2000 of the present invention includes a crudeoil supply 2010 for storing crude oil. The crude oil supply 2010 isconnected to a controllable pump 2070 whose output is connected to acontrollable flow control valve (FCV) 2120. The controllable flowcontrol valve 2120 and the controllable pump 2070 work in conjunctionunder command of the controller 2110 to control and maintain the crudeoil feed rate and pressure. The crude oil 2010 is then heated to adesired processing temperature by the heater 2130 which is controlled bycontroller 2110. In the embodiment of FIG. 2, the heated crude oilpasses through a pressure control valve 2160 before entering thedehydration mechanism 2310. The dehydration mechanism 2310 is designedto remove high salinity water from the crude oil supply 2010. Thedehydration process relies on establishing a varying high voltageelectric field in the oil phase of the dehydration mechanism 2310. Dueto the action of the imposed electric field, the droplets are agitatedcausing the drops to coalesce into droplets of sufficient size tomigrate via gravity to the lower water phase of the dehydrationmechanism 2310. The dehydration mechanism 2310 includes a liquid levelsensor (LS) 2340 used to measure the water level in the dehydrationmechanism 2310. In the embodiment of FIG. 2, the measurement output ofthe liquid level sensor 2340 is routed to the controller 2110. Thecontroller 2110 uses the liquid level measurement data to control thecontrollable flow control valve 2330 to drain the waste water from thedehydration mechanism 2310 and control the water layer and oil layerwithin the dehydration mechanism 2310. Alternatively, the liquid levelsensor 2340 output may be directly connected to a level control valveinstead of the controllable flow control valve 2330 to drain the wastewater. The controllable flow control valve 2330 is also configured toallow samples of the effluent solution to be measured at a measurementstation 2200. Measurements made on the solution samples would includebut not be limited to solution pH, solution impurity levels,temperature, and amount of residual oil present in the waste water. Thisinformation is sent to the controller 2110.

The electrical power supply 2300 provides the voltage necessary tocreate the electric field necessary for water coalescence in thedehydration mechanism 2310. The controller 2110 controls the electricalpower supply 2300 output. The electrical power supply 2300 output may bestatic (i.e. constant voltage with a current limit) or, preferably, ableto change key parameters to enhance the dehydration operation. Theelectrical power supply 2300 under the control of the controller 2110would preferably be able to alter its' output to include but not belimited to changes in the voltage level applied to the dehydrationmechanism 2310, the voltage waveform applied to the dehydrator, currentlimits (if any) on the electrical power supply 2300, or any combinationthereof.

The crude output of the dehydration mechanism 2310 passes through apressure control valve 2320 on its way to the controllable fluid mixer2350. The controllable fluid mixer 2350 allows an emulsion of crude oil2010, wash water 2020, and acid additive 2030 to be created based uponthe specific characteristics of the crude oil supply 2010 to bedesalted. The controllable fluid mixer 2350 is controlled by thecontroller 2110 to create and maintain the proper emulsion mix of crudeoil 2010, wash water 2020, and acid additive 2030.

The desalting mechanism 2000 of the present invention also includes awash water supply 2020 and a acid additive supply 2030. In theembodiment of FIG. 2, as is preferred, the acid additive 2030 is mixedwith the wash water 2020 by the controllable fluid mixer 2040 before thecrude oil/wash water emulsion is formed. Alternatively, the acidadditive 2030 could be mixed with the wash water 2020 and crude oil 2010during the emulsion creation or after emulsion creation or with thecrude oil 2010 itself. The fluid mixer 2040 is controlled by thecontroller 2110 to create and maintain the proper solution mixture ofacid additive 2030 and wash water 2020. The acid additive 2030 can beselected from the group consisting of oxalic acid, citric acid, glycolicacid, gluconic acid, C.sub.2-C.sub.4 alpha-hydroxy acids, malic acid,lactic acid, poly-hydroxy carboxylic acids, thioglycolic acid,chloroacetic acid, polymeric forms of the above hydroxyacids,poly-glycolic esters, glycolate ethers, and ammonium salt and alkalimetal salts of these hydroxyacids, and mixtures thereof.

After mixing the solution of acid additive 2030 and wash water 2020 withthe controllable fluid mixer 2040, the resulting solution is input to acontrollable flow control valve 2090 which is used to allow samples ofthe mixed acid additive 2030 and wash water 2020 solution to be measuredat a measurement station 2200. Measurements made on the solution sampleswould include but not be limited to solution pH, solution impuritylevels, and percentage of acid additive 2030 to wash water 2020. Thisinformation is sent to the controller 2110.

After mixing the solution of acid additive 2030 and wash water 2020 withthe controllable fluid mixer 2040, the resulting solution is also inputto a controllable pump 2050 whose output is connected to a controllableflow control valve 2060. The controllable pump 2050 and the flow controlvalve 2060 work in conjunction under the command of the controller 2110to control and maintain the wash water/acid solution feed rate andpressure. The output of the flow control valve 2060 is an input to thecontrollable fluid mixer 2350 where the emulsion of crude oil 2010, washwater 2020, and acid additive 2030 is formed.

After mixing the crude oil 2010, acid additive 2030, and wash water 2020in the controllable fluid mixer 2350, the resulting emulsion passesthrough a controllable flow control valve 2360 before entering theelectrostatic desalter 2170. The controllable flow control valve 2360,under command of the controller 2110, controls the flow rate of thecrude oil emulsion into the electrostatic desalter 2170 as well asallowing samples of the emulsion to be directed to the measurementstation 2200. Measurements made on the solution samples would includebut not be limited to impurity levels, temperature, amount of acidadditive 2030 and wash water 2020 solution, etc. This information issent to the controller 2110.

The electrostatic desalter 2170 includes a liquid level sensor (LS) 2210used to measure the aqueous level in the electrostatic desalter 2170. Inthe embodiment of FIG. 2, the measurement output of the liquid levelsensor 2210 is routed to the controller 2110. The controller 2110 usesthe liquid level measurement data to control the controllable flowcontrol valve 2220 to drain the effluent from the electrostatic desalter2170 and control the aqueous layer and emulsion layer within theelectrostatic desalter 2170. Alternatively, the liquid level sensor 2210output may be directly connected to a level control valve instead of thecontrollable flow control valve 2220 to drain the effluent. Thecontrollable flow control valve 2220 is also configured to allow samplesof the effluent solution to be measured at a measurement station 2200.Measurements made on the solution samples would include but not belimited to solution pH, solution impurity levels, temperature, andamount of residual oil present in the effluent. This information is sentto the controller 2110.

The electrical power supply 2150 provides the voltage necessary tocreate the electric field necessary for electrostatic coalescence in theelectrostatic desalter 2170. The controller 2110 controls the electricalpower supply 2150 output. The electrical power supply 2150 output may bestatic (i.e. constant voltage with a current limit) or, preferably, ableto change key parameters to enhance the desalting operation. Theelectrical power supply 2150 under the control of the controller 2110would preferably be able to alter its' output to include but not belimited to changes in the voltage level applied to the electrostaticdesalter 2170, the voltage waveform applied to the electrostaticdesalter 2170, current limits (if any) on the electrical power supply2150, or any combination thereof.

The desalted crude output of the electrostatic desalter 2170 passesthrough a pressure control valve 2180 and a controllable flow controlvalve 2190. The controllable flow control valve 2190 has two outputs todirect the desalted crude oil. Under control of the controller 2110, thecontrollable flow control valve 2190 controls and maintains the flowrate of desalted crude oil to the remaining refinery operations.Additionally, under control of the controller 2110, the controllableflow control valve 2190 can also direct samples of the desalted crude tothe measurement station 2200. Measurements made on the solution sampleswould include but not be limited to impurity levels, temperature,residual acid additive 2030 and wash water 2020 solution, etc. Thisinformation is sent to the controller 2110.

The controller 2110 can adjust various factors of the desaltingoperation including but not limited to the following:

The crude oil supply 2010 feed rate through the controllable pump 2070and controllable flow control valve 2120

The temperature of the crude oil supply 2010 through the controllableheater 2130.

Control of the dehydration mechanism 2310 water level and oil layersthrough the liquid level sensor 2340, the controllable flow controlvalve 2330, and the controllable flow control valve 2360.

The dehydration mechanism 2310 electric field through the controllablepower supply 2300.

The solution mixture of acid additive 2030 and wash water 2020 throughthe controllable fluid mixer 2040.

The flow rate of the solution mixture of acid additive 2030 and washwater 2020 through the controllable pump 2050 and controllable flowcontrol valve 2060.

The emulsion formation through controllable fluid mixer 2350.

The electrostatic desalter 2170 electric field through the controllableelectrical power supply 2150.

Control of the electrostatic desalter 2170 water level and emulsionlayers through the liquid level sensor 2210, the controllable flowcontrol valve 2220, and the controllable flow control valve 2190.

As different tests are conducted with the desalting mechanism 2000, theparameters are adjusted per the test matrix and the selected productmeasurements are made after desalting the crude oil supply 2010. Thememory/data storage 2100 function of the desalting mechanism 2000 allowsthe controller to access and update, if required, the control settingsrequired to conduct the test matrix tests and store the measured data.

FIG. 3 shows a diagram of a typical two stage electrostatic desaltingmechanism 3000 of the present invention.

The desalting mechanism 3000 of the present invention includes a crudeoil supply 3010 for storing crude oil. The crude oil supply 3010 isconnected to a controllable pump 3070 whose output is connected to acontrollable flow control valve (FCV) 3120. The controllable flowcontrol valve 3120 and the controllable pump 3070 work in conjunctionunder command of the controller 3110 to control and maintain the crudeoil feed rate and pressure. The crude oil 3010 is heated to a desiredprocessing temperature by the heater 3130 which is controlled bycontroller 3110. In the embodiment of FIG. 3, the heated crude oil ismixed with recycled effluent from the electrostatic desalter 3170 tocreate an emulsion mix of the crude oil supply 3010 and recycledeffluent from the electrostatic desalter 3170 via the controllable fluidmixer 3380. Use of an effluent recycle as indicated in FIG. 3 iswell-known in the art. The crude oil/effluent recycle emulsion passesthrough a pressure control valve 3160 before entering the electrostaticdesalter 3310. The electrostatic desalter 3310 includes a liquid levelsensor (LS) 3340 used to measure the aqueous level in the electrostaticdesalter 3310. In the embodiment of FIG. 3, the measurement output ofthe liquid level sensor 3340 is routed to the controller 3110. Thecontroller 3110 uses the liquid level measurement data to control thecontrollable flow control valve 3330 to drain the waste effluent fromthe electrostatic desalter 3310 and control the aqueous layer andemulsion layer within the electrostatic desalter 3310. Alternatively,the liquid level sensor 3340 output may be directly connected to a levelcontrol valve instead of the controllable flow control valve 3330 todrain the waste effluent. The controllable flow control valve 3330 isalso configured to allow samples of the waste effluent solution to bemeasured at a measurement station 3200. Measurements made on thesolution samples would include but not be limited to solution pH,solution impurity levels, temperature, and amount of residual oilpresent in the waste effluent. This information is sent to thecontroller 3110.

The electrical power supply 3300 provides the voltage necessary tocreate the electric field necessary for electrostatic coalescence in theelectrostatic desalter 3310. The controller 3110 controls the electricalpower supply 3300 output. The electrical power supply 3300 output may bestatic (i.e. constant voltage with a current limit) or, preferably, ableto change key parameters to enhance the electrostatic coalescenceoperation. The electrical power supply 3300 under the control of thecontroller 3110 would preferably be able to alter its' output to includebut not be limited to changes in the voltage level applied to theelectrostatic desalter 3310, the voltage waveform applied to thedesalter, current limits (if any) on the electrical power supply 3300,or any combination thereof.

The crude output of the electrostatic desalter 3310 passes through apressure control valve 3320 on its way to the controllable fluid mixer3350. The controllable fluid mixer 3350 allows a second emulsion ofelectrostatic desalter 3310 output, wash water 3020, and acid additive3030 to be created based upon the specific characteristics of the crudeoil supply 3010 to be desalted. The controllable fluid mixer 3350 iscontrolled by the controller 3110 to create and maintain the properemulsion mix of crude oil 3010, wash water 3020, and acid additive 3030.

The desalting mechanism 3000 of the present invention also includes awash water supply 3020 and an acid additive supply 3030. In theembodiment of FIG. 3, as is preferred, the acid additive 3030 is mixedwith the wash water 3020 by the controllable fluid mixer 3040 before thecrude oil/wash water emulsion is formed. Alternatively, the acidadditive 3030 could be mixed with the wash water 3020 and crude oil 3010during the emulsion creation or after emulsion creation or with thecrude oil 3010 itself. The fluid mixer 3040 is controlled by thecontroller 3110 to create and maintain the proper solution mixture ofacid additive 3030 and wash water 3020. The acid additive 3030 can beselected from the group consisting of oxalic acid, citric acid, glycolicacid, gluconic acid, C.sub.2-C.sub.4 alpha-hydroxy acids, malic acid,lactic acid, poly-hydroxy carboxylic acids, thioglycolic acid,chloroacetic acid, polymeric forms of the above hydroxyacids,poly-glycolic esters, glycolate ethers, and ammonium salt and alkalimetal salts of these hydroxyacids, and mixtures thereof.

After mixing the solution of acid additive 3030 and wash water 3020 withthe controllable fluid mixer 3040, the resulting solution is input to acontrollable flow control valve 3090 which is used to allow samples ofthe mixed acid additive 3030 and wash water 3020 solution to be measuredat a measurement station 3200. Measurements made on the solution sampleswould include but not be limited to solution pH, solution impuritylevels, and percentage of acid additive 3030 to wash water 3020. Thisinformation is sent to the controller 3110.

After mixing the solution of acid additive 3030 and wash water 3020 withthe controllable fluid mixer 3040, the resulting solution is also inputto a controllable pump 3050 whose output is connected to a controllableflow control valve 3060. The controllable pump 3050 and the flow controlvalve 3060 work in conjunction under the command of the controller 3110to control and maintain the wash water/acid solution feed rate andpressure. The output of the flow control valve 3060 is an input to thecontrollable fluid mixer 3350 where the second emulsion of electrostaticdesalter 3310 output, wash water 3020, and acid additive 3030 is formed.

After mixing the second emulsion in the controllable fluid mixer 3350,the second emulsion passes through a controllable flow control valve3360 before entering the electrostatic desalter 3170. The controllableflow control valve 3360, under command of the controller 3110, controlsthe flow rate of the second emulsion into the electrostatic desalter3170 as well as allowing samples of the emulsion to be directed to themeasurement station 3200. Measurements made on the solution sampleswould include but not be limited to impurity levels, temperature, amountof acid additive 3030 and wash water 3020 solution, etc. Thisinformation is sent to the controller 3110.

The electrostatic desalter 3170 includes a liquid level sensor (LS) 3210used to measure the aqueous level in the electrostatic desalter 3170. Inthe embodiment of FIG. 3, the measurement output of the liquid levelsensor 3210 is routed to the controller 3110. The controller 3110 usesthe liquid level measurement data to control the controllable flowcontrol valve 3220 to recycle the effluent from the electrostaticdesalter 3170 and control the aqueous layer and emulsion layer withinthe electrostatic desalter 3170. Alternatively, the liquid level sensor3210 output may be directly connected to a level control valve insteadof the controllable flow control valve 3220 to recycle the effluent. Thecontrollable flow control valve 3220 along with the controllable pump3370, under command of the controller 3110, control and maintain therecycled effluent flow rate and pressure to the controllable mixer 3380.The controllable flow control valve 3220 is also configured to allowsamples of the effluent solution to be measured at a measurement station3200. Measurements made on the solution samples would include but not belimited to solution pH, solution impurity levels, temperature, andamount of residual oil present in the effluent. This information is sentto the controller 3110.

The electrical power supply 3150 provides the voltage necessary tocreate the electric field necessary for electrostatic coalescence in theelectrostatic desalter 3170. The controller 3110 controls the electricalpower supply 3150 output. The electrical power supply 3150 output may bestatic (i.e. constant voltage with a current limit) or, preferably, ableto change key parameters to enhance the desalting operation. Theelectrical power supply 3150 under the control of the controller 3110would preferably be able to alter its' output to include but not belimited to changes in the voltage level applied to the electrostaticdesalter 3170, the voltage waveform applied to the electrostaticdesalter 3170, current limits (if any) on the electrical power supply3150, or any combination thereof.

The desalted crude output of the electrostatic desalter 3170 passesthrough a pressure control valve 3180 and a controllable flow controlvalve 3190. The controllable flow control valve 3190 has two outputs todirect the desalted crude oil. Under control of the controller 3110, thecontrollable flow control valve 3190 controls and maintains the flowrate of desalted crude oil to the remaining refinery operations.Additionally, under control of the controller 3110, the controllableflow control valve 3190 can also direct samples of the desalted crude tothe measurement station 3200. Measurements made on the solution sampleswould include but not be limited to impurity levels, temperature,residual acid additive 3030 and wash water 3020 solution, etc. Thisinformation is sent to the controller 3110.

The controller 3110 can adjust various parameters of the desaltingoperation including but not limited to the following:

The crude oil supply 3010 feed rate through the controllable pump 3070and controllable flow control valve 3120

The temperature of the crude oil supply 3010 through the controllableheater 3130.

Control of the electrostatic desalter 3310 aqueous level and emulsionlayers through the liquid level sensor 3340, the controllable flowcontrol valve 3330, and the controllable flow control valve 3360.

The electrostatic desalter 3310 electric field through the controllablepower supply 3300.

The solution mixture of acid additive 3030 and wash water 3020 throughthe controllable fluid mixer 3040.

The flow rate of the solution mixture of acid additive 3030 and washwater 3020 through the controllable pump 3050 and controllable flowcontrol valve 3060.

The first emulsion formation of crude oil supply 3010 and recycledeffluent from electrostatic desalter 3170 through controllable flowcontrol valve 3220, controllable pump 3370, and controllable fluid mixer3380.

The second emulsion formation through controllable fluid mixer 3350.

The electrostatic desalter 3170 electric field through the controllableelectrical power supply 3150.

Control of the electrostatic desalter 3170 water level and emulsionlayers through the liquid level sensor 3210, the controllable flowcontrol valve 3220, and the controllable flow control valve 3190.

As different tests are conducted with the desalting mechanism 3000, theparameters are adjusted per the test matrix and the selected productmeasurements are made after desalting the crude oil supply 3010. Thememory/data storage 3100 function of the desalting mechanism 3000 allowsthe controller to access and update, if required, the control settingsrequired to conduct the test matrix tests and store the measured data.

FIG. 4 shows an algorithm diagram for a multiple variable, two-levelstatistical quantification and estimation of performance for a givencrude oil desalter 4000 according to one embodiment of the presentinvention.

In step 4010, the crude oil desalter for which performance will becharacterized will be determined. The choice of crude oil desalter maybe set based upon an existing refinery infrastructure. However, thecompany or processor who performs crude oil desalting may have a choiceof desalting configurations. Thus, the processor may choose to conductthe multiple variable, two-level statistical quantification andestimation algorithm 4000 on more than one crude oil desalterconfiguration to choose the most economical configuration for processinga given crude oil type.

In step 4020, the desalter output product measurements to becharacterized and modeled are chosen. The product measurements made foreach test run may include but not be limited to the desalted crude oilsalt content, basic sediments and water content of the desalted crudeoil, the temperature of the desalted crude oil, the density of thedesalted crude oil, the viscosity of the desalted crude oil, et al.Additionally, the costs to produce the desalted crude oil output productmay also be collected for each test run.

In step 4030, the desalter parameters to be varied are chosen. Theparameters to be varied for each test run may include but not be limitedto the crude oil supply feed rate, the crude oil temperature, theelectrostatic desalter aqueous layer, the electrostatic desalteremulsion layer, the electrostatic desalter electric field, thedemulsifier type, the pH of the acid additive and wash water solution,and/or the flow rate of the acid additive and wash water solution.

In step 4040, a minimum and maximum setting are chosen for each variableselected in step 4030. The minimum and maximum setting should be at thelimits that would be used in a potential desalting application.Additionally, for the multiple variable, two-level statisticalquantification and estimation algorithm 4000, the minimum and maximumfor each variable should be chosen such that the expected effect on theproduct output is linear over the minimum and maximum setting range. Themultiple variable, two-level statistical quantification and estimate ofperformance technique 4000 can be extended to multiple min/max ranges toestimate performance in a piece-wise linear estimate for situations withintrinsically high non-linearity over an extended parameter range.

In step 4050, the 2-level test matrix is designed. The matrix identifiesthe parameter settings for all of the test combinations. Each parameteris set to one of the two ranges chosen in step 4040 for each test run.In the initial 2-level test matrix design of step 4050, all combinationsof parameter settings are tested so that all possible effects, includingparameter interactions, are independently estimated. As an example, thetest matrix developed in step 4050 would be represented by Table I if wewere measuring the cost of desalting a certain number of barrels ofcrude oil while varying three desalting parameters between two levels;the pH of the wash water and acid additive solutions (designated asparameter A), the temperature of the crude oil (designated as parameterB), and the crude oil flow rate (designated as parameter C).

TABLE I Step 4050 Example 2-Level Test Matrix for Three Parameters TestRun A B C 1 L L L 2 L L H 3 L H L 4 L H H 5 H L L 6 H L H 7 H H L 8 H HH

where represents the parameter set at the minimum value and ‘H’represents the parameter set at the maximum value.

The number of effects that can be modeled for the design of step 4050 isgiven by 2^(m)-1 where m is the number of parameters to be varied. Theprediction estimate resulting from the 2-level test matrix design ofstep 4050 is an approximation of the process response model to theparameter variations and is given by equation 1 (eq. 1), below,

$\begin{matrix}{\hat{Y} = {\overset{\_}{Y} + {\sum\limits_{i = 1}^{m}{n_{i}x_{i}}} + {\sum\limits_{i = 1}^{m - 1}{\sum\limits_{j = {i + 1}}^{m}{n_{ij}x_{i}x_{j}}}} + {\sum\limits_{i = 1}^{m - 2}{\sum\limits_{j = {i + 1}}^{m - 1}{\sum\limits_{k = {j + 1}}^{m}{n_{ijk}x_{i}x_{j}x_{k}}}}} + {\ldots \mspace{14mu} {higher}\mspace{14mu} {order}\mspace{14mu} {terms}\mspace{14mu} {as}\mspace{14mu} {applicable}}}} & {{eq}.\mspace{14mu} 1}\end{matrix}$

where Ŷ is the output estimate, Y is the average of the outputs from alltest matrix runs, n represents the coefficients for each model term, andx_(i) represents the variable parameters.

Step 4060 computes the total number of tests that must be conducted. Thetotal number of tests is given by the number of test runs times thenumber of tests per test run. In step 4110 a hypothesis test isconducted to determine the significance of each term in the predictionestimate developed in step 4050. The number of tests per test run may becomputed based upon the statistical confidence that each term placed inthe prediction equation is significant coupled with minimizing thepossibility that a significant term is determined to be insignificant.The number of test runs is determined by the test matrix design.

Decision step 4080 determines if the total number of tests isacceptable. This decision considers the resources required to conducteach test, the estimated total expense, the time that will be requiredto run the tests, etc.

If the total number of tests is determined to be too high, the number oftests is reduced in step 4070. The total number of tests may be reducedby re-designing the test matrix, reducing the number of tests per testrun, or both. If the test matrix is re-designed to eliminate test runs,there will be one or more terms eliminated in the prediction equation asa result. The choice of term to eliminate is based upon the likelihoodthat the term is significant. The impact of eliminating the term(s) inthe prediction equation is that the design will have one or more terms‘aliased’ with the eliminated term. The practical implication ofaliasing is that it will not be possible to determine whether an outputeffect is due to a lower order term, the eliminated term, or somecombination of both. Generally, higher-order terms may be eliminated ina test matrix re-design while the main effect terms and lower orderinteraction terms are preserved. In a re-designed test matrix, it isdesirable that the resulting test matrix does not alias the main effectterms

$\left( {\sum\limits_{i = 1}^{m}{n_{i}x_{i}}} \right)$

with each other or with two-way interactions

$\left( {\sum\limits_{i = 1}^{m - 1}{\sum\limits_{j = {i + 1}}^{m}{n_{ij}x_{i}x_{j}}}} \right).$

In addition, it is desirable that the two-way interactions are notaliased with one another.

In step 4090, the tests are conducted for each test run. It is desirableto run the tests in a random order to help compensate for minorvariation in uncontrolled parameters. For each test conducted in step4090,

The variable process characteristics are set to the min or max valuebased upon the test run to be conducted.

An acid additive is mixed with wash water, directly with the crude oil,or a wash water/crude oil solution.

An emulsion of acid additive, wash water, and crude oil is created

The wash water/acid additive/crude oil emulsion is resolved into an oilphase and aqueous phase.

The output response characteristics are measured and recorded for theapplicable test run.

In step 4100, a series of statistical computations are made on the datacollected in step 4090. To facilitate the computations to be made instep 4100 and step 4110, the test matrix parameter variations betweenthe minimum and maximum are transformed using the following equation(eq. 2):

$\begin{matrix}{{CS}_{i} = \frac{2 \times \left( {{AS}_{i} - {\overset{\_}{AS}}_{i}} \right)}{{Max}_{i} - {Min}_{i}}} & {{eq}.\mspace{14mu} 2}\end{matrix}$

where CS_(i) is the coded setting for parameter i, AS_(i) is the actualsetting for the parameter i, AS_(i) is the average of all the actualsettings for parameter i, Max, is the maximum actual setting forparameter i, and Min_(i) is the minimum actual setting for parameter i.The actual parameter settings are used during the test runs, the codedparameter settings are used for analysis purposes. Using thetransformation defined by eq. 2, when evaluating eq.1, each parametersetting would be defined by its coded value. For the example defined todevelop Table I, the coded test matrix values for each candidatevariable in the prediction equation would be represented by Table II.

TABLE II Example 2-Level Coded Test Matrix for Three Parameters and AllInteractions Test Run A B C AB AC BC ABC 1 −1 −1 −1 +1 +1 +1 −1 2 −1 −1+1 +1 −1 −1 +1 3 −1 +1 −1 −1 +1 −1 +1 4 −1 +1 +1 −1 −1 +1 −1 5 +1 −1 −1−1 −1 +1 +1 6 +1 −1 +1 −1 +1 −1 −1 7 +1 +1 −1 +1 −1 −1 −1 8 +1 +1 +1 +1+1 +1 +1

For each test, run in the test matrix compute the average outputresponse as (eq. 3)

$\begin{matrix}{\overset{\_}{y_{tr}} = {\sum\limits_{i = 1}^{n}\frac{y_{i}}{n}}} & {{eq}.\mspace{14mu} 3}\end{matrix}$

where y_(tr) is the average output response of each test run, y_(i) isthe output response for each test for the test run, and n is the numberof tests conducted per test run.

For each test run in the test matrix, the sample variance is alsocomputed as (eq. 4)

$\begin{matrix}{V_{tr} = {\sum\limits_{i = 1}^{n}\frac{\left( {y_{i} - \overset{\_}{y_{tr}}} \right)^{2}}{\left( {n - 1} \right)}}} & {{eq}.\mspace{14mu} 4}\end{matrix}$

where V_(tr), is the variance of the output responses for each test run,y_(tr) is the average output response of each test run, y_(i) is theoutput response for each test for the test run, and n is the number oftests conducted per test run.

For each candidate variable in the prediction equation, the differencein the average output response between the maximum settings for thevariable (i.e. coded value of +1) and the minimum settings for thevariable (i.e. coded value of −1) is computed as (eq. 5)

y _(i) = y ₊ − y ⁻   eq. 5

where y_(i) represents the difference in the average output responsebetween the maximum setting and minimum settings for the candidatevariable i, y₊ is the average output response for all test runs in whichthe candidate variable i has a coded value of +1, and y⁻ is the averageoutput response for all test runs in which the candidate variable i hasa coded value of −1.

In step 4110, a statistical hypothesis test is conducted for eachcandidate variable in the prediction equation to determine if thecandidate variable has a statistically significant contribution to theoutput response. There are many statistical methods of hypothesistesting. In the embodiment of the present invention, hypothesis testingfor the multiple variable, two-level statistical quantification andestimation of performance for a given crude oil desalter 4000 willutilize the F distribution.

The hypothesis to be tested can be defined for each candidate variablein the prediction equation as:

H₀: The average output response for +1 coded values is statisticallyequal to the average output response for −1 coded values. Therefore, thecandidate variable does not significantly contribute to the outputresponse.

H₁: The average output response for +1 coded values is statisticallydifferent from the average output response for −1 coded values.Therefore, the candidate variable does significantly contribute to theoutput response.

These two statements are called the null hypothesis (H₀) and thealternative hypothesis (H₁). There are two errors that may be made inthe hypothesis test. The first error, called a Type I error, isconcluding that the alternative hypothesis is true when in fact the nullhypothesis is true. The second error, called a Type II error, isconcluding that the null hypothesis is true when in fact the alternativehypothesis is true. In step 4110, the probability of committing a Type Ierror (a) is chosen for each candidate variable in the predictionequation.

For each candidate variable, the mean-square-between value is computedin step 4110 as (eq. 6)

$\begin{matrix}{{MSB}_{i} = {\frac{N}{4} \times \left( \overset{\overset{\_}{\_}}{y_{i}} \right)^{2}}} & {{eq}.\mspace{14mu} 6}\end{matrix}$

where MSB_(i) is the mean-square-between value for the candidatevariable i, N is the total number of tests conducted in step 4090(number of test runs times the number of tests per test run), and y_(i)is the difference in the average output response between the maximumsetting and minimum settings for the candidate variable i computed usingeq. 5 in step 4100.

For each candidate variable, the mean square error is computed in step4110 as (eq. 7)

$\begin{matrix}{{MSE} = \frac{\sum\limits_{{tr} = 1}^{k}{\left( {n - 1} \right) \times V_{tr}^{2}}}{\sum\limits_{{tr} = 1}^{k}\left( {n - 1} \right)}} & {{eq}.\mspace{14mu} 7}\end{matrix}$

where MSE is the mean square error, k is the number of test runs, n isthe number of tests per test run, and V_(tr) is the variance of theoutput responses for each test run.

In step 4110, the MSE and MSB_(i) are both estimates of the populationvariance and should be approximately equal in value if the nullhypothesis is true. It is likely that the MSE and MSB_(i) will not beexactly the same since they are estimates that are based upon differentaspects of the sample statistics (MSB_(i) is computed from the samplemeans and MSE is computed from the sample variances). However, if thealternative hypothesis is true, the MSB_(i) will compute to a largervalue due to the differences among sample means while the MSE will stillestimate the population variance because differences in population meansdo not affect variances. Thus, to determine the statistical significanceof a candidate variable in eq.1, the associated mean-square-betweenvalue is compared to the mean square error in the form of an F ratio.The F ratio to be computed for each candidate variable in step 4110 isgiven by eq. 8

$\begin{matrix}{F_{i} = \frac{{MSB}_{i}}{MSE}} & {{eq}.\mspace{14mu} 8}\end{matrix}$

where F_(i) is the F ratio for the candidate variable i, MSB_(i) is themean-square-between value for the candidate variable i, and MSE is themean square error.

In step 4110, each F_(i) is compared to the F-statistic which dependsupon the significance level (1-α), the degrees of freedom for themean-square between value (equal to one for two-levels), and the degreesof freedom for the mean square error (equal to

$\sum\limits_{{tr} = 1}^{k}\left( {n - 1} \right)$

in eq. 7). If F_(i) is less than or equal to the F-statistic, then thealternative hypothesis is rejected and the candidate variable i in eq.1is not considered significant. If F_(i) is greater than the F-statistic,then the null hypothesis is rejected with (1-α)100% confidence and thecandidate variable i in eq. 1 is considered significant. It should benoted that Y, which is the average of the outputs from all test matrixruns, is not tested for significance and is included in the predictionestimate of eq. 1. For each candidate variable i in eq.1 that isconsidered significant, the coefficient for the model term, n_(i), isgiven by eq. 9

$\begin{matrix}{n_{i} = \frac{\overset{\overset{\_}{\_}}{y_{i}}}{2}} & {{eq}.\mspace{14mu} 9}\end{matrix}$

where n_(i) is the model term coefficient for the significant candidatevariable i and y_(i) represents the difference in the average outputresponse between the maximum setting and minimum settings for thecandidate variable i.

In step 4120, the prediction equation (s) resulting from step 4110 isused to predict the response for various parameter settings. If theobjective is to minimize or maximize the output responses, the optimumsettings may be obtained using the associated prediction equations. Itshould be noted that the values for the significant parameters in theprediction equation must be in coded form (i.e. between −1 and +1). Theparameter setting may be transformed from a coded value to an actualsetting using the following calculation (eq. 10)

$\begin{matrix}{{AS}_{i} = {\frac{{CS}_{i} \times \left( {{Max}_{i} - {Min}_{i}} \right)}{2} + \overset{\_}{{AS}_{i}}}} & {{eq}.\mspace{14mu} 10}\end{matrix}$

where CS_(i) is the coded setting for parameter i, AS_(i) is the actualsetting for the parameter i, AS_(i) is the average of all the actualsettings for parameter i, Max, is the maximum actual setting forparameter i, and Min, is the minimum actual setting for parameter i.

After the parameter settings have been optimally computed using theprediction equation, a number of tests may be conducted in step 4120with the optimally computed settings to determine if the response outputstatistically agrees with the predicted output.

In decision step 4130, it is determined if more tests are necessary torefine the prediction equation. This decision is driven by theconfidence level desired for each variable in the prediction equationcoupled with the results of testing in step 4120, if any. If additionaltests are determined to be necessary, the computed prediction equationis discarded and additional tests are conducted in step 4090. If thereare no additional tests deemed necessary, the prediction equationdeveloped in step 4110 and optimized in step 4120 is consideredconfirmed.

FIG. 5 shows a process diagram 5000 of one embodiment of the method ofthe present invention for a typical crude oil desalting operation.

In step 5010, the crude oil desalter configuration is determined. Theconfiguration may be a single stage electrostatic desalting mechanism, afirst stage dehydration followed by a second stage electrostaticdesalting mechanism, a two stage desalting mechanism, or any other formof crude oil desalting mechanism.

In step 5020, the output response characteristics to be modeled andmeasured are selected. Output response characteristics that may beselected include but are not limited to the desalted crude oilimpurities, the percentage of basic sediments and water of the desaltedcrude oil, and/or the cost to desalt the oil. One or more of theselected characteristics may be measured for each test run. Eachdifferent output response will have a corresponding prediction equationmodel associated with it.

In step 5030, the process characteristics to be varied are selectedalong with the minimum and maximum variation levels. The crudeelectrostatic desalter characteristics that may potentially be variedinclude but are not limited to the crude oil feed rate, the crude oiltemperature, the dehydration/desalter electric field characteristics,the wash water flow rate, the emulsion formation, the control of thedehydration/desalter water level and emulsion layer, the acid additivetype, the acid additive rate, and the effluent recycle.

In step 5040, the appropriate statistical test matrix design isdetermined based upon the number of parameters to be varied, the numberof levels of variation, and the number of tests to be conducted per testmatrix run. The result of this step determines the total number of teststo be conducted and the potential parameter interactions whereprediction aliasing may occur.

In step 5050, the tests are conducted. Preferably, the tests are run inrandom order relative to the test matrix. For each test, the followingsteps are made:

The variable process characteristics are setup according to the selectedtest matrix run.

An acid additive is mixed with the wash water, directly with the crudeoil, or with a wash water/crude oil solution.

An emulsion of acid additive, wash water, and crude oil is created.

The crude oil is resolved into an oil phase and an aqueous phase.

The chosen output response characteristics are measured.

In step 5060, an equation or series of equations relating the outputresponses selected in step 5020 to the process characteristics selectedin step 5030 is developed. The equation (s) are based upon thestatistical computations made on the data collected in step 5050relative to the variation in the process characteristics. The variablesin the developed equations are determined to be statisticallysignificant with a (1-α)100% confidence level Where α is selected beforestep 5060 is conducted.

In step 5070, the prediction equation is optionally confirmed through aseries of experiments.

The above embodiments are merely preferred and the scope of theinvention defined by the claims below.

The method can be performed, by an oil refinery, desalter, or laboratoryequipment.

1. A method for removing calcium, iron, other metals, and amines fromcrude oil in a refinery desalting process comprising the steps of:running a plurality of tests to determine at least one statisticallysignificant processing characteristic of the refinery desalting process;adding a wash water to the crude oil; adding the wash water to the crudeoil to create an emulsion; adding to the wash water, the crude oil orthe emulsion an acid additive consisting of at least one of thefollowing: oxalic acid, citric acid, water-soluble hydroxyacid selectedfrom the group consisting of glycolic acid, gluconic acid,C.sub.2-C.sub.4 alpha-hydroxy acids, malic acid, lactic acid,poly-hydroxy carboxylic acids, thioglycolic acid, chloroacetic acid,polymeric forms of the above hydroxyacids, poly-glycolic esters,glycolate ethers, and ammonium salt and alkali metal salts of thesehydroxyacids, and mixtures thereof; resolving the emulsion containingthe acid additive into a hydrocarbon phase and an aqueous phase; andadjusting a control setting of the processing characteristic as afunction of the tests.
 2. The method as recited in claim 1 wherein thepH of the wash water, if the hydroxyacid is added to the wash water, isbelow
 6. 3. The method as recited in claim 1 wherein different controlsettings are stored for different types of crude oil.
 4. The method asrecited in claim 1 wherein the tests include a plurality of candidatevariables representing different processing characteristics.
 5. Themethod as recited in claim 4 wherein the tests include setting minimumand maximum values for the candidate variables.
 6. The method as recitedin claim 1 wherein the hydroxyacid selected is malic acid.
 7. The methodas recited in claim 1 wherein the processing characteristic is atemperature of the crude oil or wash water.
 8. The method as recited inclaim 1 wherein the processing characteristic is a crude oil supply feedrate.
 9. The method as recited in claim 1 wherein the processingcharacteristic is a temperature of the emulsion.
 10. The method asrecited in claim 1 wherein the processing characteristic is a percentageof hydroxyacid additive to the wash water.
 11. The method as recited inclaim 1 wherein the processing characteristic is a flow rate of asolution mixture of hydroxyacid additive and wash water.
 12. The methodas recited in claim 1 wherein the processing characteristic is anelectrostatic desalter electric field.
 13. The method as recited inclaim 1 wherein the processing characteristic is an electrostaticdesalter water or emulation level.
 14. The method as recited in claim 1further comprising determining a prediction equation as a function ofthe tests.
 15. The method as recited in claim 4 wherein a mean squarefunction determination is made for each candidate variable.
 16. A methodfor improving a refinery desalting process comprising the steps of:providing a range of values for at least one candidate variablerepresenting a desalting process characteristic; performing astatistical calculation to determine at least one statisticallysignificant candidate variable of the at least one candidate variablewhich is statistically significant for improving the refinery desaltingprocess; and adjusting a control setting of the desalting process as afunction of the statistical calculation.
 17. The method as recited inclaim 16 wherein the range of values includes a minimum value and amaximum value.
 18. The method as recited in claim 16 wherein the atleast one candidate variable includes a plurality of candidate values.19. A crude oil refinery, crude oil desalter, or laboratory environmentoperating the method as recited in claim
 1. 20. A crude oil refinery,crude oil desalter, or laboratory environment operating the method asrecited in claim 16.